package com.cuit.riskassessment.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cuit.riskassessment.dao.depart.DepartInfoMapper;
import com.cuit.riskassessment.service.DepartInfoService;
import com.cuit.riskassessment.vo.DepartInfo;
@Service(value = "departInfoServiceObject" )
public class DepartInfoServiceImpl implements DepartInfoService {
	@Autowired
	@Resource(name = "departInfoMapper")
	private DepartInfoMapper mapper;
	@Override
	public void add(DepartInfo departInfo) {
		mapper.add(departInfo);
	}

	@Override
	public void del(String id) {
		mapper.del(id);
	}

	@Override
	public List<DepartInfo> getByElement(String name, String val) {
		return mapper.getByElement(name, val);
	}

	@Override
	public boolean getCd(String cd) {
		if (mapper.getCd(cd)==null||mapper.getCd(cd).equals("")) {
			return false;
		}
		return true;
	}

	@Override
	public void update(DepartInfo departInfo) {
		mapper.update(departInfo);
	}

	@Override
	public List<DepartInfo> getAll() {
		// TODO Auto-generated method stub
		return mapper.getAll();
	}

}
